<template>
  <div class="resume-detail-skill info-group">
    <div class="info-group-title">专业技能</div>
    <div class="info-group-content">
      <div class="skill-item" v-for="(item, index) in data" :key="index">
        <div class="skill-item-top">
          <div class="skill-name">{{ item.skillName }}</div>
          <div class="skill-proficiency-chart">
            <div
              class="skill-proficiency-value"
              :class="'level-' + item.proficiency"
            ></div>
          </div>
          <div class="skill-proficiency-name">{{ item.proficiencyName }}</div>
        </div>
        <div class="skill-time">使用时长：{{ item.time }}</div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ResumeDetailSkill',
  props: {
    data: {
      type: Array,
      default: () => []
    }
  }
}
</script>

<style lang="scss">
@import 'styles/common.scss';
.resume-detail-skill {
  .skill-item {
    margin-top: 0.3rem;
    .skill-item-top {
      display: flex;
      align-items: center;
      padding-right: 2rem;
      .skill-name {
        width: 150px;
        font-size: 16px;
        color: $colorText1;
      }
      .skill-proficiency-chart {
        flex: 1;
        height: 14px;
        background-color: #ddd;
        border-radius: 7px;
        overflow: hidden;
        .skill-proficiency-value {
          background-color: $colorPrimary;
          height: 100%;
          &.level-1 {
            width: 30%;
          }
          &.level-3 {
            width: 60%;
          }
          &.level-5 {
            width: 90%;
          }
        }
      }
      .skill-proficiency-name {
        margin-left: 0.33rem;
        width: 100px;
      }
    }
    .skill-time {
      margin-top: 0.19rem;
    }
  }
}
</style>
